//package com.example.easyutils.util;
//
//import android.app.Dialog;
//import android.content.Context;
//import android.view.Gravity;
//import android.view.Window;
//import android.view.WindowManager;
//
//import androidx.annotation.NonNull;
//
//import com.example.easyutils.R;
//
//public class DialogImage extends Dialog {
//    public DialogImage(@NonNull Context context) {
//        super(context);
//    }
//
//    private void show() {
//        Dialog dialog = new Dialog(this);
//        //去掉标题线
//        dialog.requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
//        dialog.setContentView(R.layout.dialog);
//        //背景透明
//        dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
//        dialog.show();
//
//        Window window = dialog.getWindow();
//        WindowManager.LayoutParams lp = window.getAttributes();
//        lp.gravity = Gravity.CENTER; // 居中位置
//        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
//        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
//        window.setAttributes(lp);
//        window.setWindowAnimations(R.style.mystyle);  //添加动画
//    }
//}
